<?php
/* 
 * 系统配置文件
 * @author samuel
 * @date 2009-05-03
 */

if(!defined('IN_SYS')) die('非法访问！');

if(!defined('ROOT_PATH')){
    $cfg_path = rtrim(str_replace('\\', '/', dirname(__FILE__)) , '/');
    $root_path = substr($cfg_path, 0, strrpos($cfg_path, '/') ) . '/';
    define('ROOT_PATH', $root_path );
}


//常量定义
if(!defined('CLASS_PATH'))      define('CLASS_PATH', ROOT_PATH . 'classes/');
if(!defined('MODULE_PATH'))     define('MODULE_PATH', ROOT_PATH . 'modules/');
if(!defined('INCLUDE_PATH'))    define('INCLUDE_PATH', ROOT_PATH . 'includes/');
if(!defined('IMAGE_PATH'))      define('IMAGE_PATH', ROOT_PATH . 'images/');
if(!defined('JS_PATH'))         define('JS_PATH', ROOT_PATH . 'js/');
if(!defined('LANG_PATH'))       define('LANG_PATH', ROOT_PATH . 'languages/');
if(!defined('TPL_PATH'))        define('TPL_PATH', ROOT_PATH . 'templates/');
if(!defined('THEME_PATH'))      define('THEME_PATH', TPL_PATH . 'themes/');
if(!defined('WAP_PATH'))        define('WAP_PATH', ROOT_PATH . 'wap/');

if(!defined('CLASS_URL'))      define('CLASS_URL', ROOT_URL . 'classes/');
if(!defined('MODULE_URL'))     define('MODULE_URL', ROOT_URL . 'modules/');
if(!defined('INCLUDE_URL'))    define('INCLUDE_URL', ROOT_URL . 'includes/');
if(!defined('IMAGE_URL'))      define('IMAGE_URL', ROOT_URL . 'images/');
if(!defined('JS_URL'))         define('JS_URL', ROOT_URL . 'js/');
if(!defined('LANG_URL'))       define('LANG_URL', ROOT_URL . 'languages/');
if(!defined('TPL_URL'))        define('TPL_URL', ROOT_URL . 'templates/');
if(!defined('THEME_URL'))      define('THEME_URL', TPL_URL . 'themes/');
if(!defined('WAP_URL'))        define('WAP_URL', ROOT_URL . 'wap/');


//配置初始化
$_CFG = array();

//全局路径
$_CFG['root_path'] = ROOT_PATH;

//主题配置
$_CFG['theme'] = 'default';

//数据库配置
$_CFG['db_host']        = 'localhost';
$_CFG['db_user']        = 'root';
$_CFG['db_password']    = '';
$_CFG['db_name']        = 'project_justfun';
$_CFG['db_charset']     = 'utf8';
$_CFG['db_prefix']      = '';

//Smarty配置
$_CFG['smarty_cache']           = false;
$_CFG['smarty_template_dir']    = THEME_PATH . $_CFG['theme'];
$_CFG['smarty_compile_dir']     = TPL_PATH . 'compiled';
$_CFG['smarty_cache_dir']       = TPL_PATH . 'caches';
$_CFG['smarty_cache_lifetime']  = 60 * 60;
$_CFG['smarty_left_delimiter']  = "<!--{";
$_CFG['smarty_right_delimiter'] = "}-->";

//Cache配置
$_CFG['cache_lifetime']     = 1800;
$_CFG['cache_enable']       = 0;
$_CFG['cache_path']         = "";

//COOKIE配置
$_CFG['cookie_path']        = "/";
$_CFG['cookie_domain']      = "";

//SESSION配置
$_CFG['session_lifetime']   = 1800;

//其他配置
$_CFG['sys_timezone']       = "Asia/Shanghai";
$_CFG['sys_admindir']       = "";
$_CFG['no_auth_module']		= array('admin::login');


//全局化
$GLOBALS['_CFG'] = $_CFG;

header("Content-Type: text/html; charset=utf-8");
?>
